package com.synway.scheduling;

import com.synway.handler.SpiderHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ProxyTaskScheduling {
    @Value("${python.rootPath}")
    private String rootPath;
    @Value("${python.env}")
    private String pythonEnv;

    //每天1：00执行
    @Scheduled(cron = "0 00 01 ? * *")
    private void proxyTask(){
        SpiderHandler.ptoxyHandler(rootPath,pythonEnv,"proxies.py");
    }
}
